package io.renren.modules.business.service.impl;

import io.renren.modules.business.dao.BusRecruitmentPlanDao;
import io.renren.modules.business.entity.BusRecruitmentPlanEntity;
import io.renren.modules.business.service.BusRecruitmentPlanService;
import io.renren.modules.sys.entity.SysUserEntity;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Service;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;


@Service("busRecruitmentPlanService")
public class BusRecruitmentPlanServiceImpl extends ServiceImpl<BusRecruitmentPlanDao, BusRecruitmentPlanEntity>
        implements BusRecruitmentPlanService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        String institutionName = (String) params.get("key");
        IPage<BusRecruitmentPlanEntity> page = this.page(
                new Query<BusRecruitmentPlanEntity>().getPage(params),
                new QueryWrapper<BusRecruitmentPlanEntity>()
                .like(StringUtils.isNotBlank(institutionName), "institution_name", institutionName)
        );
        return new PageUtils(page);
    }

}